//package com.cqrt.service.impl;
//
//import com.ty.basic.handler.exceptionhandler.exception.ResponseCodeEnum;
//import com.ty.basic.handler.exceptionhandler.exception.TyException;
//import com.ty.ppm.api.service.admin.ProjectService;
//import com.ty.ppm.api.service.plan.PlanService;
//import com.ty.ppm.model.entity.admin.Project;
//import com.ty.ppm.model.entity.plan.Plan;
//import com.ty.ppm.service.service.impl.plan.PlanActiveOperateServiceImpl;
//import org.springframework.context.annotation.Primary;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.math.BigInteger;
//import java.util.Objects;
//
//@Primary
//@Service
//public class RTPlanActiveOperateServiceImpl extends PlanActiveOperateServiceImpl {
//    @Resource
//    private PlanService planService;
//    @Resource
//    private ProjectService projectService;
//
//    /**
//     * 删除项目发布状态检查
//     * @param planOid
//     * @return
//     */
//    @Override
//    public Plan planPublishCheck(BigInteger planOid) {
//        Plan plan = planService.selectOneByOID(planOid);
//        if (Objects.isNull(plan)) {
//            TyException.throwSingleTyExceptionVarargs(ResponseCodeEnum.BIZ_OBJECT_NOT_FOUND, new String[]{"项目计划"});
//        }
//
//        if (Boolean.TRUE.equals(plan.isLocked())) {
//            TyException.throwSingleTyExceptionVarargs(ResponseCodeEnum.BIZ_COMMON_OBJ_LOCK_CANNOT_OPERATE, new String[]{"项目计划[" + plan.getName() + "]", plan.getLockUserName()});
//        }
//
//        Project project = projectService.selectOneByOID(plan.getParentOID());
//        if (Objects.isNull(project)) {
//            TyException.throwSingleTyExceptionVarargs(ResponseCodeEnum.BIZ_OBJECT_NOT_FOUND, new String[]{"项目"});
//        }
//        return plan;
//    }
//}
